import jdk.internal.dynalink.support.TypeUtilities;
import jdk.nashorn.internal.ir.CaseNode;

import java.util.Scanner;

public class test08 {


    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请你输入机票原价");
        double money = sc.nextDouble();
        System.out.println("请你输入月份");
        int month = sc.nextInt();
        System.out.println("请你输入仓位类型");
        String type = sc.next();

        double sum = Sale(money, month, type);
        System.out.println("最终价格是" + sum);


    }

    //
    public static double Sale(double money, int month, String type) {
        if (month >= 5 && month <= 10) {
            switch (type) {
                case "头等舱":
                     money *= 0.9;
                    break;
                case "经济舱":
                    money *= 0.85;
                break;
                default:
                    System.out.println("数据有误");

                    break;
            }
        } else if (month == 11 || month == 12 || month >= 1 && month <= 4) {
            switch (type) {
                case "头等舱":
                     money *= 0.7;
                break;
                case "经济舱":
                     money *= 0.65;
                break;
                default:
                    System.out.println("数据有误");
                    break;
            }
        } else {
            System.out.println("你输入的月份问题");
        }
        return money;
    }

}

